package com.jwm.power.repository;

import com.jwm.power.model.entity.LogisticsTracking;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface LogisticsRepository extends JpaRepository<LogisticsTracking, Integer>, JpaSpecificationExecutor<LogisticsTracking> {
    @Query(value = "SELECT SJDW FROM [KFWXDB].[dbo].[CPFHD] WHERE BZ LIKE %:company% And XSRY = :XSRY AND FJRQ BETWEEN :startDate AND :endDate", nativeQuery = true)
    List<LogisticsTracking> findSJDWByBZAndXSRYAndFJRQBetween(@Param("company")String company, @Param("XSRY")String XSRY, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
    @Override
    List<LogisticsTracking> findAll();
}
